<?php
/**
 * Created by zengxianfen on 2020/7/20 15:02.
 */

namespace App\Controller;

use App\Model\Service\UserService;
use App\Request\LoginRequest;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;

/**
 * @Controller()
 * Class LoginController
 * @package App\Controller
 */
class LoginController extends AbstractController
{

    /**
     * @Inject()
     * @var UserService
     */
    public $service;


    /**
     * @RequestMapping("/login", methods={RequestMapping::POST})
     * @author zengxianfen 2020/7/28
     */
    public function login(LoginRequest $request){
        $this->service->login($request->all());
        return $this->success('', []);
    }

    public function logout(){}

    public function register(){}
}